package com.example.demo.entity;

import java.io.Serializable;

/**
 * 
 * @TableName pet
 */
public class Pet implements Serializable {
    /**
     * 编号
     */
    private Integer id;

    /**
     * 归属用户
     */
    private User user;

    /**
     * 宠物名字
     */
    private String petName;

    /**
     * 年龄
     */
    private String petAge;

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    public Integer getId() {
        return id;
    }

    /**
     * 编号
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 归属用户
     */
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }


    /**
     * 宠物名字
     */
    public String getPetName() {
        return petName;
    }

    /**
     * 宠物名字
     */
    public void setPetName(String petName) {
        this.petName = petName;
    }

    /**
     * 年龄
     */
    public String getPetAge() {
        return petAge;
    }

    /**
     * 年龄
     */
    public void setPetAge(String petAge) {
        this.petAge = petAge;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Pet other = (Pet) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPetName() == null ? other.getPetName() == null : this.getPetName().equals(other.getPetName()))
            && (this.getPetAge() == null ? other.getPetAge() == null : this.getPetAge().equals(other.getPetAge()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPetName() == null) ? 0 : getPetName().hashCode());
        result = prime * result + ((getPetAge() == null) ? 0 : getPetAge().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
//        sb.append(", user=").append(user.toString());
        sb.append(", petName=").append(petName);
        sb.append(", petAge=").append(petAge);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}